const axios = require('axios')
const baseURL = 'http://localhost:3000'

// 获取用户列表
export async function getCouponList (params) {
  console.log('获取优惠券列表数据')
  console.log(params)
  return await axios({
    method: 'post',
    url: baseURL + '/api/getCouponList',
    data: {
      ...params
    }
  })
}

// 删除优惠券
export async function delCouponByid (params) {
  console.log('按id删除优惠券')
  console.log(params)
  return await axios({
    method: 'post',
    url: baseURL + '/api/delCouponByid',
    data: {
      params
    }
  })
}

// 更新优惠券上下架状态
export async function updateCouponUpShelvesState (params) {
  console.log('更新优惠券上下架状态')
  console.log(params)
  return await axios({
    method: 'post',
    url: baseURL + '/api/updateCouponUpShelvesState',
    data: {
      ...params
    }
  })
}
